/**
 * Selling Partner API for Listings Items
 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2021-08-01
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'
import { ItemImage } from './ItemImage.js'

/**
 * The ItemSummaryByMarketplace model module.
 * @module listingsitems_v2021_08_01/model/ItemSummaryByMarketplace
 * @version 2021-08-01
 */
export class ItemSummaryByMarketplace {
  /**
   * Constructs a new <code>ItemSummaryByMarketplace</code>.
   * Summary details of a listings item for an Amazon marketplace.
   * @alias module:listingsitems_v2021_08_01/model/ItemSummaryByMarketplace
   * @class
   * @param marketplaceId {String} A marketplace identifier. Identifies the Amazon marketplace for the listings item.
   * @param productType {String} The Amazon product type of the listings item.
   * @param status {[String]} Statuses that apply to the listings item.
   * @param createdDate {Date} The date the listings item was created in ISO 8601 format.
   * @param lastUpdatedDate {Date} The date the listings item was last updated in ISO 8601 format.
   */
  constructor (marketplaceId, productType, status, createdDate, lastUpdatedDate) {
    this.marketplaceId = marketplaceId
    this.productType = productType
    this.status = status
    this.createdDate = createdDate
    this.lastUpdatedDate = lastUpdatedDate
  }

  /**
   * Constructs a <code>ItemSummaryByMarketplace</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {ItemSummaryByMarketplace} obj Optional instance to populate.
   * @return {ItemSummaryByMarketplace} The populated <code>ItemSummaryByMarketplace</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new ItemSummaryByMarketplace()
      if (data.hasOwnProperty('marketplaceId')) { obj.marketplaceId = ApiClient.convertToType(data.marketplaceId, 'String') }
      if (data.hasOwnProperty('asin')) { obj.asin = ApiClient.convertToType(data.asin, 'String') }
      if (data.hasOwnProperty('productType')) { obj.productType = ApiClient.convertToType(data.productType, 'String') }
      if (data.hasOwnProperty('conditionType')) { obj.conditionType = ApiClient.convertToType(data.conditionType, 'String') }
      if (data.hasOwnProperty('status')) { obj.status = ApiClient.convertToType(data.status, ['String']) }
      if (data.hasOwnProperty('fnSku')) { obj.fnSku = ApiClient.convertToType(data.fnSku, 'String') }
      if (data.hasOwnProperty('itemName')) { obj.itemName = ApiClient.convertToType(data.itemName, 'String') }
      if (data.hasOwnProperty('createdDate')) { obj.createdDate = ApiClient.convertToType(data.createdDate, 'Date') }
      if (data.hasOwnProperty('lastUpdatedDate')) { obj.lastUpdatedDate = ApiClient.convertToType(data.lastUpdatedDate, 'Date') }
      if (data.hasOwnProperty('mainImage')) { obj.mainImage = ItemImage.constructFromObject(data.mainImage) }
    }
    return obj
  }
}

/**
 * A marketplace identifier. Identifies the Amazon marketplace for the listings item.
 * @member {String} marketplaceId
 * @type {String}
 */
ItemSummaryByMarketplace.prototype.marketplaceId = undefined

/**
 * Amazon Standard Identification Number (ASIN) of the listings item.
 * @member {String} asin
 * @type {String}
 */
ItemSummaryByMarketplace.prototype.asin = undefined

/**
 * The Amazon product type of the listings item.
 * @member {String} productType
 * @type {String}
 */
ItemSummaryByMarketplace.prototype.productType = undefined

/**
 * Allowed values for the <code>conditionType</code> property.
 * @enum {String}
 * @readonly
 */
ItemSummaryByMarketplace.ConditionTypeEnum = {

  /**
     * value: "new_new"
     * @const
     */
  new_new: 'new_new',

  /**
     * value: "new_open_box"
     * @const
     */
  new_open_box: 'new_open_box',

  /**
     * value: "new_oem"
     * @const
     */
  new_oem: 'new_oem',

  /**
     * value: "refurbished_refurbished"
     * @const
     */
  refurbished_refurbished: 'refurbished_refurbished',

  /**
     * value: "used_like_new"
     * @const
     */
  used_like_new: 'used_like_new',

  /**
     * value: "used_very_good"
     * @const
     */
  used_very_good: 'used_very_good',

  /**
     * value: "used_good"
     * @const
     */
  used_good: 'used_good',

  /**
     * value: "used_acceptable"
     * @const
     */
  used_acceptable: 'used_acceptable',

  /**
     * value: "collectible_like_new"
     * @const
     */
  collectible_like_new: 'collectible_like_new',

  /**
     * value: "collectible_very_good"
     * @const
     */
  collectible_very_good: 'collectible_very_good',

  /**
     * value: "collectible_good"
     * @const
     */
  collectible_good: 'collectible_good',

  /**
     * value: "collectible_acceptable"
     * @const
     */
  collectible_acceptable: 'collectible_acceptable',

  /**
     * value: "club_club"
     * @const
     */
  club_club: 'club_club'
}

/**
 * Identifies the condition of the listings item.
 * @member {String} conditionType
 * @type {String}
 */
ItemSummaryByMarketplace.prototype.conditionType = undefined

/**
 * Allowed values for the <code>status</code> property.
 * @enum {String}
 * @readonly
 */
ItemSummaryByMarketplace.StatusEnum = {

  /**
     * value: "BUYABLE"
     * @const
     */
  BUYABLE: 'BUYABLE',

  /**
     * value: "DISCOVERABLE"
     * @const
     */
  DISCOVERABLE: 'DISCOVERABLE'
}

/**
 * Statuses that apply to the listings item.
 * @member {[String]} status
 * @type {[String]}
 */
ItemSummaryByMarketplace.prototype.status = undefined

/**
 * The fulfillment network stock keeping unit is an identifier used by Amazon fulfillment centers to identify each unique item.
 * @member {String} fnSku
 * @type {String}
 */
ItemSummaryByMarketplace.prototype.fnSku = undefined

/**
 * The name or title associated with an Amazon catalog item.
 * @member {String} itemName
 * @type {String}
 */
ItemSummaryByMarketplace.prototype.itemName = undefined

/**
 * The date the listings item was created in ISO 8601 format.
 * @member {Date} createdDate
 * @type {Date}
 */
ItemSummaryByMarketplace.prototype.createdDate = undefined

/**
 * The date the listings item was last updated in ISO 8601 format.
 * @member {Date} lastUpdatedDate
 * @type {Date}
 */
ItemSummaryByMarketplace.prototype.lastUpdatedDate = undefined

/**
 * @member {ItemImage} mainImage
 * @type {ItemImage}
 */
ItemSummaryByMarketplace.prototype.mainImage = undefined
